package edu.unr.cater.npap.server.locator;

import com.google.web.bindery.requestfactory.shared.Locator;
import edu.unr.cater.npap.client.domain.Address;
import org.springframework.roo.addon.gwt.RooGwtLocator;
import org.springframework.stereotype.Component;

@RooGwtLocator("edu.unr.cater.npap.client.domain.Address")
@Component
public class AddressLocator extends Locator<Address, Integer> {

    public Address create(Class<? extends edu.unr.cater.npap.client.domain.Address> clazz) {
        return new Address();
    }

    public Address find(Class<? extends edu.unr.cater.npap.client.domain.Address> clazz, Integer id) {
        return Address.findAddress(id);
    }

    public Class<edu.unr.cater.npap.client.domain.Address> getDomainType() {
        return Address.class;
    }

    public Integer getId(Address address) {
        return address.getAddressId();
    }

    public Class<java.lang.Integer> getIdType() {
        return Integer.class;
    }

    public Object getVersion(Address address) {
        return address.getVersion();
    }
}
